package com.fangcun.common.redis;

import java.util.Set;

public interface RedisService {
	/**
	 * 删除多个key
	 * 
	 * @param keys
	 */
	public void remove(Integer datebase, final String... keys);

	/**
	 * 删除一个key
	 * 
	 * @param key
	 */
	public void remove(Integer datebase, final String key);

	/**
	 * 得到对应的value
	 * 
	 * @param key
	 * @return
	 */
	public Object get(Integer datebase, final String key);

	/**
	 * set一个对象
	 * 
	 * @param key
	 * @param value
	 * @param expireTime
	 */
	public boolean set(Integer datebase, final String key, String value, Integer expireTime);

	/**
	 * set时间
	 * 
	 * @param key
	 * @param expireTime
	 */
	public boolean setExpire(Integer datebase, final String key, Integer expireTime);

	/**
	 * 判断key是否存在
	 * 
	 * @param key
	 * @return
	 */
	public boolean exists(Integer datebase, final String key);

	/**
	 * 得到key时间
	 * 
	 * @param key
	 * @return
	 */
	public Long ttl(Integer datebase, final String key);

	/**
	 * 配置多个key
	 * 
	 * @param pattern
	 * @return
	 */
	public Set<String> matchKeys(Integer datebase, String pattern);

}
